//
//  OuathAuthViewController.h
//  OuathAuth
//
//  Created by JayaKarthigayan on 23/06/10.
//  Copyright Apple Inc 2010. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SA_OAuthTwitterController.h"
#import <SystemConfiguration/SCNetworkReachability.h>
#include <netinet/in.h>

BOOL isTwitterOpened;


@class SA_OAuthTwitterEngine;
@protocol OuathAuthViewControllerDelegate 
-(void)didAuthenticatedWithUserName:(NSString *)userName;
-(void)didAuthenticatedCancel;
@end

@interface OuathAuthViewController : UIViewController <SA_OAuthTwitterControllerDelegate,UITextViewDelegate>{
	SA_OAuthTwitterEngine				*_engine;
	
	NSString *appTwitterAccount;
	NSString *sharedLink;
	UITextView *txtMessage;
	UILabel* lblCharLeft;
	NSString *twitMessage;

	UIAlertView* messageDialog;
	int maxCharLength;
	SA_OAuthTwitterController *sa_OAuthTwitterController;
	
	id <OuathAuthViewControllerDelegate> delegate;
	UIViewController *prnttViewController;
	
	UIView *mMessageDialog;
	
	
	///// creating UIbutton for posting data and cancel posting
	UIButton *mPostData;
	UIButton *mCancelData;
	UIView *mTransparentImg;
}
//@property (nonatomic, assign) BOOL isAuthentc;
@property(nonatomic, retain) SA_OAuthTwitterEngine				*_engine;
@property(nonatomic,retain) NSString* sharedLink;
@property(nonatomic,retain) NSString* twitMessage;
@property(nonatomic,retain) NSString* appTwitterAccount;
@property(nonatomic,retain)SA_OAuthTwitterController *sa_OAuthTwitterController;
@property(nonatomic ,retain)	UIView *mMessageDialog;
@property(nonatomic,retain)	UIButton *mPostData,*mCancelData;


@property (nonatomic, assign) id <OuathAuthViewControllerDelegate> delegate;

-(void)createAlert;
-(NSString*)returnUserName;
-(void)Login :(id)parent;
- (void) twit:(NSString*)text withLink:(NSString*)link forapp:(NSString *)twitAppname makeTiny:(BOOL)yesOrno :(id)parent;
-(void)setFrame :(UIInterfaceOrientation)fromInterfaceOrientation ;
- (BOOL) connectedToNetwork;
- (void)logoutOfTwitter;
@end

